export default url => {
    const crud = window.$crud(url)
    const getAllMap = () => window.$axios({
      url:   'datav/visualmaps',
      method: 'get'
    });
     const getList = (params) => window.$axios({
        url:   'datav/visualmap/page',
        method: 'get',
        params: params
      });
      
       const getObj = (id) => window.$axios({
        url:   `datav/visualmap/${id}`,
        method: 'get'
      });
      
       const addObj = (data) => window.$axios({
        url:   'datav/visualmap',
        method: 'post',
        data: data
      });
       const updateObj = (id,data) => window.$axios({
        url:  `datav/visualmap/${id}`,
        method: 'put',
        data: data
      });
       const delObj = (id) => window.$axios({
        url:  `datav/visualmap/${id}`,
        method: 'delete'
      });
    return {
        ...crud,
        getAllMap,
        getList,
        getObj,
        addObj,
        updateObj,
        delObj
    }
}